package demo_05;

import com.neu.dao.BaseDao;

import java.util.List;
import java.util.Map;

/**
 * 专门对bookinfo表进行sql语句编写的位置
 */
public class BookInfoDao extends BaseDao {
    public static void main(String[] args) {
        BookInfoDao b = new BookInfoDao();
//        System.out.println("受影响的行为："+b.update());
    }

    public List<Map<String, Object>> select() {
        List<Map<String, Object>> list = null;
        String sql = "select * from tbl_book_info where b_id=?";
        list = super.executeQuery(sql, "1");
        return list;
    }

    public int update() {
        String sql = "INSERT INTO tbl_book_info(b_no,b_name,b_price)\n"
                + "VALUES('123','java基础',56)";
        int r = super.executeUpdate(sql);
        return r;
    }
}
